package com.example.graduatetest.activitys;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import com.example.graduatetest.R;
import com.example.graduatetest.databinding.ActivityCreateClassBinding;
import com.example.graduatetest.view.model.CreateClassViewModel;
import com.example.graduatetest.view.model.LoginViewModel;

public class CreateClassActivity extends AppCompatActivity {
    ActivityCreateClassBinding binding;
    CreateClassViewModel createClassViewModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_create_class);
        //隐藏ActionBar
        if(getSupportActionBar() != null){
            ActionBar actionBar = getSupportActionBar();
            actionBar.hide();
        }

        binding = DataBindingUtil.setContentView(this,R.layout.activity_create_class);

        //LiveData
        createClassViewModel = ViewModelProviders.of(this).get(CreateClassViewModel.class);
        binding.setCreateClassViewModel(createClassViewModel);
        binding.setLifecycleOwner(this);
        createClassViewModel.init(this,binding);

    }
}
